/*************************************************************************
	> File Name: Strategy.cc
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-22 14:49:16
 ************************************************************************/

#include "Strategy.h"

#include <iostream>

using std::cout;
using std::endl;

Context::Context(Strategy * pStrategy)
    :_pStrategy(pStrategy)
{
    cout << "Context(Strategy *)" << endl;
}

Context::~Context(){
    cout << "~Context()" << endl;

    delete _pStrategy;
    _pStrategy = nullptr;
}

void Context::ContextInterface(){
    if(nullptr != _pStrategy){
        _pStrategy->AlgorithmInterface();
    }
}

void ConcreateStrategyA::AlgorithmInterface(){
    cout << "AlgorithmInterface Implemented by ConcreateStrategyA" << endl;
}
